/*
 * @Author: wu07 1732042133@qq.com
 * @Date: 2023-01-10 10:56:30
 * @LastEditors: wu07 1732042133@qq.com
 * @LastEditTime: 2023-02-01 15:36:52
 * @FilePath: \recruitAPP\recruitApp\recruitApp\vite.config.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// 1.导入node的path路径模块
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      // 配置别名
      "~": path.resolve(__dirname, "src")
    }
  },
  plugins: [vue()],
  server: {
    proxy: {
      '/api': {
        target: 'http://localhost:3000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
});
